import http from "@/utils/http";
import { h } from "vue";

export const getHotelByPageAPI = (
  page: number,
  pageSize: number,
  hotelName: string
) => {
  return http({
    url: "/api/v2/hotel/getByPage",
    method: "GET",
    params: {
      page,
      pageSize,
      hotelName,
    },
  });
};

export const addHotelAPI = (
  id: any,
  hotelName: string,
  price: number,
  starLevel: string,
  position: string,
  region: string
) => {
  return http({
    url: "/api/v2/hotel/add",
    method: "POST",
    data: {
      id,
      hotelName,
      price,
      starLevel,
      position,
      region,
    },
  });
};

export const updateHotelAPI = (
  id: string,
  hotelName: string,
  price: number,
  starLevel: string,
  position: string,
  region: string
) => {
  return http({
    url: "/api/v2/hotel/update",
    method: "POST",
    data: {
      id,
      hotelName,
      price,
      starLevel,
      position,
      region,
    },
  });
};

export const deleteHotelAPI = (hotelId: string) => {
  return http({
    url: "/api/v2/hotel/delete",
    method: "POST",
    params: {
      hotelId,
    },
  });
};

